﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace Liang.Util
{
    /// <summary>
    /// 数据验证
    /// </summary>
    public static class ValidateData
    {
        /// <summary>
        /// 正则表达式验证
        /// </summary>
        /// <param name="el">正则表达式字符串</param>
        /// <param name="str">验证的字符串</param>
        /// <returns></returns>
        public static bool validateReg(string el, string str)
        {
            bool result = true;
            Regex reg = new Regex(el);
            if (!reg.IsMatch(str))
            {
                result = false;
            }
            return result;
        }
    }
}
